package com.lijian.controller.api;

import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("${api-url}")
public class ApiController {

    /**
     * 公共的api访问接口做页面跳转
     * /api/findPage?pageName=user/user-list
     * @param modelAndView
     * @param pageName
     * @return
     */
    @GetMapping("/findPage")
    @ApiOperation(value = "公用的页面跳转接口", notes = "公用的页面跳转接口")//描述
    public ModelAndView findPage(ModelAndView modelAndView, String pageName){
        modelAndView.setViewName(pageName);
        return modelAndView;
    }
}
